package com.park.web.controller.pub;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.park.client.model.book.BookModel;
import com.park.client.service.book.BookService;
import com.park.web.contant.Global;
import com.park.web.controller.BaseController;

@Controller
@RequestMapping("/public/book")
public class PublicBookController extends BaseController{

	@Autowired
	private BookService bookService;
	
	/**
	 * 图书详情
	 */
	@RequestMapping("detail/{id}")
	public String detail(@PathVariable("id")Long id,HttpServletRequest request){
		BookModel book = bookService.selectByPrimaryKey(id);
		request.setAttribute("book", book);
		logger.info("================wwwwwwwwwwwww");
		return Global.PUBLIC_PATH+"book/bookDetail";
	}
	
}
